package com.yenlien.traceyun.plant.bean;

import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;

/**
 * @Date 2023/10/24
 * @Author jiaLong
 * @Descript 山东仁科设备DTO
 */
public class SDRKDevDTO {

    @ApiModelProperty(value = "是否保存报警数据 0:不保存 1:保存")
    private Integer alarmRecord;

    @ApiModelProperty(value = "报警开关  1: 离线报警\n" +
                                        "2: 超限报警\n" +
                                        "4：复归通知\n" +
                                        "3: 离线报警+超限报警\n" +
                                        "5：离线报警+复归通知\n" +
                                        "6：超限报警+复归通知\n" +
                                        "7：离线报警+超限报警+复归通知")
    private Integer alarmSwitch;


    @ApiModelProperty(value = "设备地址码")
    private String deviceAddr;


    @ApiModelProperty(value = "设备名称")
    private String deviceName;


    @ApiModelProperty(value = "分组 id")
    private String groupId;


    @ApiModelProperty(value = "纬度")
    private String lat;

    @ApiModelProperty(value = "经度")
    private String Lng;

    @ApiModelProperty(value = "离线判断间隔")
    private Integer offlineinterval;


    @ApiModelProperty(value = "保存数据间隔")
    private Short savedatainterval;

    @ApiModelProperty(value = "排序权重")
    private Integer sort;


    @ApiModelProperty(value = "设备编码")
    private String deviceCode;


    @ApiModelProperty(value = "是否标记经纬度 false:否 true:是")
    private Boolean useMarkLocation;


    @ApiModelProperty(value = "JSON字符串 " +
            "factorId String 因子 id\n" +
            "deviceAddr Integer 设备地址\n" +
            "nodeId Integer 节点 id\n" +
            "registerId Integer 寄存器 id\n" +
            "factorName String 因子名称\n" +
            "factorIcon String 因子图标\n" +
            "coefficient Float 系数\n" +
            "offset Float 偏差\n" +
            "alarmDelay Integer 报警延时(秒)\n" +
            "alarmRate Integer 报警频率（分钟）\n" +
            "backToNormalDelay Integer 复归延时（秒）\n" +
            "digits Integer 小数位数\n" +
            "unit String 单位\n" +
            "enabled Boolean 是否启用 true:启用 false:关闭\n" +
            "sort Integer 排序权重(数字越大权重越高）\n" +
            "maxVoiceAlarmTimes Integer 单次报警语音最大发送条数\n" +
            "maxSmsAlarmTimes Integer 单次报警短信最大发送条数")
    private String factors;




    public Integer getAlarmRecord() {
        return alarmRecord;
    }

    public void setAlarmRecord(Integer alarmRecord) {
        this.alarmRecord = alarmRecord;
    }

    public Integer getAlarmSwitch() {
        return alarmSwitch;
    }

    public void setAlarmSwitch(Integer alarmSwitch) {
        this.alarmSwitch = alarmSwitch;
    }

    public String getDeviceAddr() {
        return deviceAddr;
    }

    public void setDeviceAddr(String deviceAddr) {
        this.deviceAddr = deviceAddr;
    }

    public String getDeviceName() {
        return deviceName;
    }

    public void setDeviceName(String deviceName) {
        this.deviceName = deviceName;
    }

    public String getGroupId() {
        return groupId;
    }

    public void setGroupId(String groupId) {
        this.groupId = groupId;
    }

    public String getLat() {
        return lat;
    }

    public void setLat(String lat) {
        this.lat = lat;
    }

    public String getLng() {
        return Lng;
    }

    public void setLng(String lng) {
        Lng = lng;
    }

    public Integer getOfflineinterval() {
        return offlineinterval;
    }

    public void setOfflineinterval(Integer offlineinterval) {
        this.offlineinterval = offlineinterval;
    }

    public Short getSavedatainterval() {
        return savedatainterval;
    }

    public void setSavedatainterval(Short savedatainterval) {
        this.savedatainterval = savedatainterval;
    }

    public Integer getSort() {
        return sort;
    }

    public void setSort(Integer sort) {
        this.sort = sort;
    }

    public String getDeviceCode() {
        return deviceCode;
    }

    public void setDeviceCode(String deviceCode) {
        this.deviceCode = deviceCode;
    }

    public Boolean getUseMarkLocation() {
        return useMarkLocation;
    }

    public void setUseMarkLocation(Boolean useMarkLocation) {
        this.useMarkLocation = useMarkLocation;
    }

    public String getFactors() {
        return factors;
    }

    public void setFactors(String factors) {
        this.factors = factors;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;

        if (o == null || getClass() != o.getClass()) return false;

        SDRKDevDTO SDRKDevDTO = (SDRKDevDTO) o;

        return new EqualsBuilder()
                .append(alarmRecord, SDRKDevDTO.alarmRecord)
                .append(alarmSwitch, SDRKDevDTO.alarmSwitch)
                .append(deviceAddr, SDRKDevDTO.deviceAddr)
                .append(deviceName, SDRKDevDTO.deviceName)
                .append(groupId, SDRKDevDTO.groupId)
                .append(lat, SDRKDevDTO.lat)
                .append(Lng, SDRKDevDTO.Lng)
                .append(offlineinterval, SDRKDevDTO.offlineinterval)
                .append(savedatainterval, SDRKDevDTO.savedatainterval)
                .append(sort, SDRKDevDTO.sort)
                .append(deviceCode, SDRKDevDTO.deviceCode)
                .append(useMarkLocation, SDRKDevDTO.useMarkLocation)
                .append(factors, SDRKDevDTO.factors)
                .isEquals();
    }

    @Override
    public int hashCode() {
        return new HashCodeBuilder(17, 37)
                .append(alarmRecord)
                .append(alarmSwitch)
                .append(deviceAddr)
                .append(deviceName)
                .append(groupId)
                .append(lat)
                .append(Lng)
                .append(offlineinterval)
                .append(savedatainterval)
                .append(sort)
                .append(deviceCode)
                .append(useMarkLocation)
                .append(factors)
                .toHashCode();
    }

    @Override
    public String toString() {
        return "SDRKDevDTO{" +
                "alarmRecord=" + alarmRecord +
                ", alarmSwitch=" + alarmSwitch +
                ", deviceAddr=" + deviceAddr +
                ", deviceName='" + deviceName + '\'' +
                ", groupId='" + groupId + '\'' +
                ", lat='" + lat + '\'' +
                ", Lng='" + Lng + '\'' +
                ", offlineinterval=" + offlineinterval +
                ", savedatainterval=" + savedatainterval +
                ", sort=" + sort +
                ", deviceCode='" + deviceCode + '\'' +
                ", useMarkLocation=" + useMarkLocation +
                ", factors='" + factors + '\'' +
                '}';
    }
}
